package se.webbzon.boltzmann.game.sequence.condition;

import se.webbzon.boltzmann.game.sequence.Sequence;
import se.webbzon.boltzmann.game.sequence.Sequences;

public class IsMatch extends ConditionSequenceNode {

	/*============================================================
	Constructors
	============================================================*/

	public IsMatch(Sequence sequence, String lh, String rh) {
		super(sequence,lh,rh);
	}
	
	/*============================================================
	Public Methods
	============================================================*/

	@Override public boolean isTrue() {
		Sequence seq = getSequence();
		String lh = (String) Sequences.parse(seq, getLeftHandArgument());
		String rh = (String) Sequences.parse(seq, getRightHandArgument());
		return lh.toUpperCase().equals(rh.toUpperCase());
			
	}
	
}
